<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<h1>
	<spring:message code="account.detail.title" />
	<strong> ${compte.libelle} </strong> <span class="account_number">(<spring:message code="account.declaration.numero" /> ${compte.numero})</span>
</h1>

<form id="choixMois" method="post" action="">

	<span class="filter"><spring:message code="account.detail.filter"/></span>&nbsp; &nbsp;
	<select id="annees" name="annee">
		<c:forEach var="monAnnee" items="${listeAnnees}">
			<option value="${monAnnee}"
				<c:if test="${monAnnee==annee}"> selected="selected"</c:if>>${monAnnee}</option>
		</c:forEach>
	</select>
	<select id="mois" name="mois">
		<c:forEach var="monMois" items="${listeMois}">
			<option value="${monMois.key}"
				<c:if test="${monMois.key==mois}"> selected="selected"</c:if>>
				<spring:message code="${monMois.value}"/>
			</option>
		</c:forEach>
	</select>
	<input type="submit" value="Afficher" />
</form>

<table id="operation">
	<tr>
		<th>Date</th>
		<th>Type</th>
		<th>D&eacute;tail</th>
		<th>D&eacute;bit</th>
		<th>Cr&eacute;dit</th>
	</tr>

	<c:forEach var="operation" items="${listOperations}">
		<c:choose>
			<c:when test="${pageScope.var == 'case1'}">
				<c:set var="var" value="case2" />
				<tr class="case1">
			</c:when>
			<c:otherwise>
				<c:set var="var" value="case1" />
				<tr class="case2">
			</c:otherwise>
		</c:choose>

		<td>${operation.dateFormatee}</td>
		<td>${operation.typeOperation}</td>
		<td>${operation.detail}</td>
		<c:choose>
			<c:when test="${ operation.montant < 0 }">
				<td class="solde red">${operation.montant} &euro;</td>
				<td class="solde"></td>
			</c:when>
			<c:otherwise>
				<td class="solde"></td>
				<td class="solde">${operation.montant} &euro;</td>
			</c:otherwise>
		</c:choose>
		</tr>
	</c:forEach>
</table>
<a id="back_link" href="<%=request.getContextPath()%>/user/home.html"><spring:message
		code="account.detail.back" /> </a>